<!--
/*
 * SPDX-License-Identifier: GPL-3.0-or-later
 * Copyright 2014 The moOde audio player project / Tim Curtis
*/
-->
<div id="container">
<div class="container">
    <h1 class="lib-config">格式化本地NVMe驱动器</h1>
    <p>
        从列表中选择一个NVMe驱动器进行格式化。
        该驱动器将被格式化为一个单一的EXT4分区（卷）。
        由于格式化将擦除驱动器上的所有数据，因此在点击“格式化”按钮后将出现确认对话框。
    </p>

    <form class="form-horizontal" action="lib-config.php" method="post">
        <legend>NVMe驱动器
            <a href="#format-nvme-drive-modal" data-toggle="modal"><button id="btn-format-nvme-drive" class="legend-config btn btn-medium btn-primary">格式化</button></a>
        </legend>

        <div class="control-group">
            <label class="control-label" for="nvme-drive">驱动器</label>
            <div class="controls">
                <select id="nvme-drive" name="nvme_drive" class="config-select-large">
                    $_nvme_drives
                </select>
                <a aria-label="帮助" class="config-info-toggle" data-cmd="info-nvme-drives" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
                <span id="info-nvme-drives" class="config-help-info">
                    显示NVMe驱动器的设备ID以及括号中的卷标签或状态，例如“未格式化”或“无标签”。
                </span>
            </div>

            <label class="control-label" for="nvme-drive-label">卷标签</label>
            <div class="controls">
                <input class="config-input-large" type="text" pattern="[A-Za-z0-9\-_ ]{1,25}" id="nvme-drive-label" name="nvme_drive_label" value="$_nvme_drive_label">
                <a aria-label="帮助" class="config-info-toggle" data-cmd="info-nvme-drive-label" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
                <span id="info-nvme-drive-label" class="config-help-info">
                    此NVMe驱动器的卷标签。当驱动器随后被选择挂载时，将显示标签。
                </span>
            </div>
        </div>
    </form>
</div>
</div>

<form class="form-horizontal" method="post">
    <div id="format-nvme-drive-modal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="format-nvme-drive-label" aria-hidden="true">
        <div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h3>格式化NVMe驱动器？</h3>
        </div>
        <div class="modal-body txtmid">
            格式化将擦除驱动器上的所有数据。
            <div id="modal-nvme-drive-txt"></div>
            <input id="modal-nvme-drive" type="hidden" name="nvme_drive" value="$_nvme_drive">
            <input id="modal-nvme-drive-label" type="hidden" name="nvme_drive_label" value="$_nvme_drive_label">
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
            <button id="btn-format-nvme-drive-submit" class="btn btn-primary btn-submit" type="submit" name="nvme_format_drive" value="1">是</button>
        </div>
    </div>
</form>
